//导入request.js 工具
import request from "@/utils/request";


//作业管理列表查询
export const HomeworkAllService = (params)=>{
    /* const tokenStore = useTokenStore();
    //在pinia中定义的响应式数据都不需要.value
    return request.get('/homework/all',{headers:{'Authorization':tokenStore.token}}) */
    return request.get('/homework/all',{params:params});
};

//作业新增
export const HomeworkAddService = (HomeworkData) => {
     return request.post('/homework/add',HomeworkData);
};

//作业修改
export const HomeworkUpdateService = (HomeworkData) => {
  return request.put('/homework/updateHomeworkAndQuestions', HomeworkData);
};

//删除作业
export const HomeworkDeleteService = (homeworkId) => {
    return request.delete('/homework/delete?homeworkId='+homeworkId);
};

  // 查询作业与题目
  export const HomeworkFindService = (params) => {
    return request.get('/homework/find', { params: params });
  };

  //用户作业成绩分页查询 
export const HomeworkUserPageService = (params) => {
  return request.get('/HomeworkScore/findPageAll',{params:params});
};
//用户作业成绩添加
export const HomeworkUserAddService = (HomeworkData) => {
  return request.post('/HomeworkScore/add',HomeworkData);
};
//用户作业成绩修改
export const HomeworkUserUpdateService = (HomeworkData) => {
  return request.put('/HomeworkScore/update',HomeworkData);
};
//用户作业成绩删除
export const HomeworkUserDeleteService = (id) => {
  return request.delete('/HomeworkScore/delete?id='+id);
};